<extend name="Index/index" />
<block name="nav"></block>
<block name="nav1">
    <div class="page-content">
        <div class="page-header">
            <h1>
                短趣管理
                <small>
                    <i class="icon-double-angle-right"></i>
                     查看
                </small>
            </h1>
        </div><!-- /.page-header -->
    </div>
</block>
<block name="admin">
    <div class="col-md-12 pull-left">
        <h1 class="text-center">短趣管理</h1>
        <div class="col-md-12">
            <button class="btn btn-info" id="btn">添加短趣</button>
            <img src="">
            <hr>
        </div>
        <div id="add" style="display:none;">
            <h1  class="col-md-offset-2">添加短趣</h1>
            <hr>
            <form action="<{:U('Short/add')}>" method="post" class="col-md-offset-1">
                <input type="text" name="title" placeholder="请输入短趣标题" class="text-center" size="60" style="font-size:15px;height:50px;"><br><br>
                <textarea name="content" cols="60" rows="10"></textarea><br>
                <button class="btn btn-info">上传短趣</button>
            </form>
        </div>

        <empty name="data">
            <h1 class="text-center red">暂无数据</h1>
        <else />
            <volist name="data" id="v">
                <div class="bbs col-md-3 col-md-offset-1 mt120">
                    <div class="box">
                        <div class="notice"><div class="col-md-3">短趣 : <{$v['id']}></div><div class="col-md-9"> 上传时间: <{$v['time']}></div></div>
                        <form action="<{:U('Short/edit')}>" method="post">
                            <input type="hidden" name="id" value="<{$v['id']}>">
                            <input type="text" name="title" class="text-center" size="50" value="<{$v['title']}>" style="font-size:15px;height:50px;">
                            <textarea name="content" cols="50" rows="12" maxlength="300"><{$v['content']}></textarea>
                            <hr>
                            <button class="btn btn-info">修改</button>
                            <a href="<{:U('Short/del', array('id'=>$v['id']))}>" class="btn btn-danger">删除</a>
                            <div class="kb"> </div>
                        </form>
                    </div>
                </div>
            </volist>
        </empty>
    </div>
    <div class="container col-md-10 col-md-offset-1" style="margin-top:180px;">
        <!-- 分页 -->
        <div class="text-center">
            <{$page}>
        </div>
    </div>

    <script type="text/javascript">
        $('#btn').click(function(){
            $('#add').toggle(1111);
        })
    </script>
</block>
